package com.weic.easycache.framework;

import android.os.Handler;

public abstract class AbsAutoLoginActivity extends AbsDataActivity {
	private boolean autoLoginExeuted = false;
	
	@Override
	protected void onResume() {
		super.onResume();
		if (!autoLoginExeuted && !UserHelper.isLogined() && !UserHelper.hasLogout()) {
			autoLoginExeuted = true;
			new Handler().postDelayed(new Runnable() {
				@Override
				public void run() {
					UserHelper.autoLogin(AbsAutoLoginActivity.this);
				}
			}, 1000);
		}
		autoLoginExeuted = true; // 避免退出时，再次自动登录
	}
}
